import 'package:flutter/material.dart';
import './button_demo.dart';
import './floating_action_button_demo.dart';
import './popup_menu_button_demo.dart';
import './form_demo.dart';
import './checkbox_demo.dart';
import './radio_demo.dart';
import './switch_demo.dart';
import './slider_demo.dart';
import './expansion_panel_demo.dart';
import './chip_demo.dart';
import './date_time_demo.dart';
import './simple_dialog_demo.dart';
import './alert_dialog_demo.dart';
import './bottom_sheet_demo.dart';
import './snack_bar_demo.dart';
import './data_table_demo.dart';
import './card_demo.dart';
import './stepper_demo.dart';

class MaterialComponents extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('MaterialComponents'),
        elevation: 0,
      ),
      body: ListView(
        children: [
          ListItem(
            title: 'stepper',
            page: StepperDemo(),
          ),
          ListItem(
            title: 'card',
            page: CardDemo(),
          ),
          ListItem(
            title: 'data_table',
            page: DataTableDemo(),
          ),
          ListItem(
            title: 'chip',
            page: ChipDemo(),
          ),
          ListItem(
            title: 'expansionPanel',
            page: ExpansionPanelDemo(),
          ),
          ListItem(
            title: 'snack_bar',
            page: SnackBarDemo(),
          ),
          ListItem(
            title: 'bottom_sheet',
            page: BottomSheetDemo(),
          ),
          ListItem(
            title: 'alert_dialog',
            page: AlertDialogDemo(),
          ),
          ListItem(
            title: 'simple_dialog',
            page: SimpleDialogDemo(),
          ),  ListItem(
            title: 'date',
            page: DateTimeDemo(),
          ),
          ListItem(
            title: 'sliderDemo',
            page: SliserDemo(),
          ),
          ListItem(
            title: 'switchDemo',
            page: SwitchDemo(),
          ),
          ListItem(
            title: 'radioDemo',
            page: RadioDemo(),
          ),
          ListItem(
            title: 'CheckboxDemo',
            page: CheckboxDemo(),
          ),
          ListItem(
            title: 'FormDemo',
            page: FormDemo(),
          ),
          ListItem(
            title: 'PopupMenuButton',
            page: PopupMenuButtonDemo(),
          ),
          ListItem(
            title: 'button',
            page: ButtonDemo(),
          ),
          ListItem(
            title: 'floating',
            page: FloatingActionButtonDemo(),
          ),
        ],
      ),
    );
  }
}

class ButtonDemo1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('button'),
        elevation: 0,
      ),
      body: Container(
        padding: EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [],
            )
          ],
        ),
      ),
    );
  }
}




class ListItem extends StatelessWidget {
  late final String title;
  late final Widget page;

  ListItem({
    required this.title,
    required this.page,
  });

  @override
  Widget build(BuildContext context) {
    return ListTile(
      title: Text(title),
      onTap: () {
        Navigator.of(context).push(
          MaterialPageRoute(builder: (context) => page),
        );
      },
    );
  }
}
